package combination;

/**
 * @Author: Doream
 * @Date: 2022/1/28 21:18
 */
public class Test {
    public static void main(String[] args) {
        MenuComponent root = new Menu("系统管理", 1);

        MenuComponent menuManagement = new Menu("菜单管理", 2);
        menuManagement.add(new MenuItem("页面访问", 3));
        menuManagement.add(new MenuItem("展开菜单", 3));
        menuManagement.add(new MenuItem("编辑菜单", 3));
        menuManagement.add(new MenuItem("删除菜单", 3));
        menuManagement.add(new MenuItem("新增菜单", 3));

        MenuComponent competenceManagement = new Menu("权限管理", 2);
        competenceManagement.add(new MenuItem("页面访问", 3));
        competenceManagement.add(new MenuItem("提价保存", 3));

        MenuComponent roleManagement = new Menu("角色管理", 2);
        roleManagement.add(new MenuItem("页面访问", 3));
        roleManagement.add(new MenuItem("新增角色", 3));
        roleManagement.add(new MenuItem("修改角色", 3));

        root.add(menuManagement);
        root.add(competenceManagement);
        root.add(roleManagement);

        root.print();
    }
}
